package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderService;
import com.itheima.service.OrderSettingService;
import com.itheima.util.DateUtils;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.springframework.stereotype.Component;

@Component
public class ClearOldOrderSettingJob {

    @Reference
    public OrderSettingService orderSettingService;

    /*
    * 定时清理本月以前预约设置历史数据
    *
    * */
    public void clearOldOrderSetting() throws Exception {

        //获取本月第一天日期
       String firstDayOfThisMonth =DateUtils.parseDate2String(DateUtils.getFirstDay4ThisMonth());

        orderSettingService.clearOldOrderSetting(firstDayOfThisMonth);

    }


}
